package cn.analysis.project.service.impl;

import cn.analysis.common.utils.ListUtils;
import cn.analysis.project.mapper.AlarmMapper;
import cn.analysis.project.service.IAlarmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/** 告警 服务层 实现 */
@Service
public class AlarmServiceImpl implements IAlarmService {

    @Autowired
    private AlarmMapper alarmMapper;

    /** 获取系统中所有的告警信息 */
    @Override
    public List<Map<String, Object>> selectListAllAlarm(String code) {
        List<Map<String, Object>> objs = alarmMapper.selectListObj(code);
        List<Map<String, Object>> levels = alarmMapper.selectListLevel(code);
        List<Map<String, Object>> buss = alarmMapper.selectListBus(code);
        List objects = ListUtils.addAll(objs, levels, buss);
        return objects;
    }
}
